package com.richie696.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
public class User {

    private Long id;
    private String name;
    private Integer age;
    @TableField("email")
    private String mail;
    @TableField(exist = false)  // 非DB字段
    private String address;
    @TableField(select = false) // 不查询该字段
    private String intro;
    // 乐观锁字段
    @Version
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long version;
}
